package dca.sistemascontrole.view.grafico;

import dca.sistemascontrole.dao.GraphicDataManager;
import java.awt.Frame;

/**
 *
 * @author Rafael
 */
public class OfflineChartsDialog extends javax.swing.JDialog {

    private GraphicDataManager dataManager;

    public OfflineChartsDialog(java.awt.Frame parent, boolean modal) {
        super(parent, modal);
        initComponents();
        
        pnlGraficoNivel.setMaximunVisiblePeriod(1000 * 60 * 5);
        pnlGraficoTensao.setMaximunVisiblePeriod(1000 * 60 * 5);
    }

    public OfflineChartsDialog(GraphicDataManager dataManager, Frame owner, boolean modal) {
        this(owner, modal);
        this.dataManager = dataManager;
        
        
        pnlGraficoNivel.setValues(dataManager.getNivelTanqueInferior(), dataManager.getNivelTanqueSuperior());
        pnlGraficoTensao.setValues(dataManager.getNivelSinalControle());
    }

    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        jPanel1 = new javax.swing.JPanel();
        pnlGraficoNivel = new dca.sistemascontrole.view.grafico.GraficoNivel();
        pnlGraficoTensao = new dca.sistemascontrole.view.grafico.GraficoTensao();

        setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE);

        jPanel1.setLayout(new java.awt.GridLayout(0, 1));

        pnlGraficoNivel.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(0, 0, 0)));
        jPanel1.add(pnlGraficoNivel);

        pnlGraficoTensao.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(0, 0, 0)));
        jPanel1.add(pnlGraficoTensao);

        getContentPane().add(jPanel1, java.awt.BorderLayout.CENTER);

        pack();
    }// </editor-fold>//GEN-END:initComponents
    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JPanel jPanel1;
    private dca.sistemascontrole.view.grafico.GraficoNivel pnlGraficoNivel;
    private dca.sistemascontrole.view.grafico.GraficoTensao pnlGraficoTensao;
    // End of variables declaration//GEN-END:variables
}
